package site.jlopen.entity.file;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class FileUploadRes {

	private int status;
	
	private String msg;
	
	private String name;
	
	private String rename;
	
	private String path;
	
	private String url;
	
	private long size;
	

	public static FileUploadRes error(String msg) {
		FileUploadRes res = new FileUploadRes();
		res.setStatus(1);
		res.setMsg(msg);
		return res;
	}
	
	/**
	* @param name <a>原名</a>
	* @param rename <a>重命名</a>
	* @param path <a>保存路径</a>
	* @param url <a>访问路径</a>
	* @param size <a>大小(字节)</a>
	 */
	public static FileUploadRes success(String name, String rename, String path, String url, long size) {
		FileUploadRes res = new FileUploadRes();
		res.setStatus(0);
		res.setMsg("SUCCESS");
		res.setName(name);
		res.setRename(rename);
		res.setPath(path);
		res.setUrl(url);
		res.setSize(size);
		return res;
	}

	@Override
	public String toString() {
		return "FileUploadRes [status=" + status + ", msg=" + msg + ", name=" + name + ", rename=" + rename
				+ ", path=" + path + ", url=" + url + ", size=" + size + "]";
	}

}
